

import weka.classifiers.Evaluation;

public class WekaResult {
	public String summaryString;
	public String matrixString;
	public String classDetailsString;
	public String cumulativeMarginDistributionString;
	public double correct;
	public double incorrect;
	public double pctCorrect;
	public double pctIncorrect;
	public double correlationCoefficient;
	public double meanAbsoluteError;
	public double rootMeanSquaredError;
	public double numInstances;
	public double unclassified;
	public double pctUnclassified;

	public WekaResult () throws NoSuchMethodException {		// do not use this constructor, it returns a useless object
		throw new NoSuchMethodException ();
	}
	
	public WekaResult (Evaluation eval) {
		try {
			this.summaryString = eval.toSummaryString();
			this.matrixString = eval.toMatrixString();
			this.classDetailsString = eval.toClassDetailsString();
			this.cumulativeMarginDistributionString = eval.toCumulativeMarginDistributionString();
			this.correct = eval.correct();
			this.incorrect = eval.incorrect();
			this.pctCorrect = eval.pctCorrect();
			this.pctIncorrect = eval.pctIncorrect();
			this.correlationCoefficient = eval.correlationCoefficient();
			this.meanAbsoluteError = eval.meanAbsoluteError();
			this.rootMeanSquaredError = eval.rootMeanSquaredError();
			this.numInstances = eval.numInstances();
			this.unclassified = eval.unclassified();
			this.pctUnclassified = eval.pctUnclassified();
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
